﻿/// ---------------------------------------------
///
/// 江懷玉
///
/// ---------------------------------------------

///--------------------
///2012.4.30 汪定新添加
//双击事件
function CustomDbClick() {
    fnCustomEdit();
}
///--------------------

var fnCustomAdd = function () {
    document.getElementById("dialog1_h").innerHTML = "添加项目经历";
    document.getElementById("EditUIWindow").src = "AutoLoadForm.aspx?r=" + Math.random() + "&entity=" + const_EditEntity;
    SetDWH(450, 300, YAHOO.example.container.dialog1);
    YAHOO.example.container.dialog1.show();
}
var fnCustomEdit = function () {
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    document.getElementById("dialog1_h").innerHTML = "修改项目经历";
    document.getElementById("EditUIWindow").src = "AutoLoadForm.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&id=" + record.getData(const_entityID);
    SetDWH(450, 300, YAHOO.example.container.dialog1);
    YAHOO.example.container.dialog1.show();
}

var fnAddEduHistory = function () {
}

if (typeof ($) != "undefined") {
    $(document).ready(function () {
        //$("#IDCardNO").bind('blur', fnChekcIDCard);
        try {
            if (getPar1('id') == "") {
                //alert(parent.parent.getPar1('id'));
                instance[0].EmployeeID = parent.parent.getPar1('id');
            } 
        } catch (e)
        { }
    });
}

var fnCheckData = function () {
    if ($("#ProjectName").val() == "") {
        return "项目名称不能为空！";
    }
    var num = $("#Partners").val();
    if (num == "") {
        return "参与人数不能为空！";
    }
    if (/^([0-9])(\d*)$/.test(num) == false) {
        return "参与人数需要输入数字";
    }
    var begin = $("#BeginDate").val();
    if (begin == "") {
        return "开始日期不能为空！";
    }
    var end = $("#EndDate").val();
    if (end == "") {
        return "结束日期不能为空！";
    }
    if (begin > end) {
        return "开始日期>结束日期，不允许!";
    }
    if ($("#Role").valueOf() == "") {
        return "角色不能为空！";
    }
    if ($("#ProjectDesc").val() == "") {
        return "项目描述不能为空！";
    }
}